﻿<Page x:Class="PearTunes.Client.LocalMusicPage"
	  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
      mc:Ignorable="d" 
      d:DesignHeight="428" d:DesignWidth="588"
	Title="LocalMusicPage">
    <Page.Resources>
        <Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Width" Value="8"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Cursor" Value="SizeWE"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="CustomDataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="FontWeight" Value="Bold"></Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                        <Grid>
                            <Microsoft_Windows_Themes:DataGridHeaderBorder IsClickable="{TemplateBinding CanUserSort}" IsPressed="{TemplateBinding IsPressed}" IsHovered="{TemplateBinding IsMouseOver}" SortDirection="{TemplateBinding SortDirection}" Height="20" OpacityMask="Black" OverridesDefaultStyle="False" BorderThickness="0,0,1,0" Padding="7,0,0,0">
                                <Microsoft_Windows_Themes:DataGridHeaderBorder.BorderBrush>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFE1E1E1" Offset="0"/>
                                        <GradientStop Color="#FFA6A6A6" Offset="1"/>
                                    </LinearGradientBrush>
                                </Microsoft_Windows_Themes:DataGridHeaderBorder.BorderBrush>
                                <Microsoft_Windows_Themes:DataGridHeaderBorder.SeparatorBrush>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="Black" Offset="0"/>
                                        <GradientStop Color="White" Offset="1"/>
                                    </LinearGradientBrush>
                                </Microsoft_Windows_Themes:DataGridHeaderBorder.SeparatorBrush>
                                <Microsoft_Windows_Themes:DataGridHeaderBorder.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="White" Offset="0.964"/>
                                        <GradientStop Color="#FFE1E1E1"/>
                                        <GradientStop Color="#FFA6A6A6" Offset="1"/>
                                    </LinearGradientBrush>
                                </Microsoft_Windows_Themes:DataGridHeaderBorder.Background>
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Microsoft_Windows_Themes:DataGridHeaderBorder>
                            <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}"/>
                            <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="{x:Static DataGrid.FocusBorderBrushKey}" Color="#FF000000"/>
        <Style x:Key="CustomDataGridCellStyle" TargetType="{x:Type DataGridCell}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualState x:Name="Unselected"/>
                                    <VisualState x:Name="Selected"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{DynamicResource SelectionBrush2}"/>
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
                    <Setter Property="BorderBrush" Value="{DynamicResource SelectedBorder2}"/>
                </Trigger>
                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static DataGrid.FocusBorderBrushKey}}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
        <LinearGradientBrush x:Key="SelectionBrush2" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF6BAEE1" Offset="0.032"/>
            <GradientStop Color="#FF428BD1" Offset="1"/>
            <GradientStop Color="#FF7CB9E5"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="SelectedBorder2" Color="#FF5DA1DA"/>
    </Page.Resources>
    <Grid>
        <DataGrid AutoGenerateColumns="False" Name="musicDataGrid" ItemsSource="{Binding}" Background="White" AlternatingRowBackground="#FFF2F5F9" HorizontalGridLinesBrush="{x:Null}" VerticalGridLinesBrush="{x:Null}" BorderBrush="#FFD2D2D2" Foreground="Black" ColumnHeaderStyle="{DynamicResource CustomDataGridColumnHeaderStyle}" CellStyle="{DynamicResource CustomDataGridCellStyle}" SelectionMode="Single" Margin="0,0,0,0" IsReadOnly="True" CanUserReorderColumns="True" AreRowDetailsFrozen="False" CanUserSortColumns="False" IsSynchronizedWithCurrentItem="{x:Null}" IsTextSearchEnabled="True" RowDetailsVisibilityMode="VisibleWhenSelected">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Cím" Binding="{Binding Title}" Width="200" IsReadOnly="True" />
                <DataGridTextColumn Header="Idő" Binding="{Binding Length}" Width="60" IsReadOnly="True" />
                <DataGridTextColumn Header="Előadó" Binding="{Binding Artist}" Width="105" IsReadOnly="True" />
                <DataGridTextColumn Header="Album" Binding="{Binding Album}" Width="130" IsReadOnly="True" />
                <DataGridTextColumn Header="Műfaj" Binding="{Binding Genre}" Width="80" IsReadOnly="True" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Page>
